package com.captain.special.数组;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * Des:
 *
 * @author XL
 * @Date 2022/4/17 22:08
 */
public class 存在重复元素217 {
    public boolean containsDuplicate(int[] nums) {
        Set<Integer> set = new HashSet<>();
        for (int num : nums) {
            if (set.contains(num)) {
                return true;
            }
            set.add(num);
        }
        return false;
    }
}
